package zuoye50;

import java.util.Scanner;

public class Homework06 {
public static void main(String[] args) {
	Scanner sc=new Scanner(System.in);
	int m=sc.nextInt();
	int n=sc.nextInt();
	int a=m*n;
	while(n!=0){
		int t=m%n;
		m=n;
		n=t;
	}
	System.out.println(m + " " + a/m);
}
}
